package com.herench.bunch.clinic.support;


import com.herench.bunch.clinic.handler.ProxyMsgCodeConstant;
import com.herench.bunch.commons.support.AbstractMessageHandler;
import com.herench.bunch.commons.support.WsClientFactory;
import org.apache.cxf.endpoint.Client;
import org.dom4j.Document;


/**
 * Created by ThinkPad on 2017/8/24.
 */

public abstract class AbstractClinicMessageHandler extends AbstractMessageHandler {


    protected  Object proxyInvoke(Object inMessage) throws Exception{
        Document message = (Document) inMessage;

        Client client = WsClientFactory.getInstance().getWsClient(ProxyMsgCodeConstant.HIS_WS_URL);
        Object[] res = client.invoke(ProxyMsgCodeConstant.HIS_WS_DEFAULT_OPERATION, message.asXML());
        return  res[0];
    }
}
